package com.cn.goodsadmin.service;

import com.cn.goodsadmin.po.Lottery;
import com.cn.goodsadmin.po.Realgoods;
import com.cn.goodsadmin.po.Realprize;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("lotteryService")
public class LotteryService extends BaseService{

    public void save(Lottery lottery) throws Exception{
        lotteryDao.save(lottery);
    }

    public void savePrize(Realprize realprize)throws Exception{
        realPrizeDao.save(realprize);
    }

    public void  deletePrize(Realprize realprize)throws Exception{
        realPrizeDao.delete(realprize);
    }

    public List<Realprize> getAllPrize()throws Exception{
        return realPrizeDao.getAllRealPrize();
    }

    public List<Lottery> getAllLottery(int appid)throws Exception{
        return lotteryDao.findAllLottery(appid);
    }

    public void update(Lottery lottery)throws Exception{
        lotteryDao.update(lottery);
    }

    public void delete(Lottery lottery)throws Exception{
        lotteryDao.delete(lottery);
    }

    public List<Realgoods>  getAllRealGoods(int appid)throws Exception{
        return realGoodsDao.findAllRealGoods(appid);
    }

    public void saveRealGoods(Realgoods realgoods)throws Exception{
        realGoodsDao.save(realgoods);
    }

    public void updateRealGoods(Realgoods realgoods)throws Exception{
        realGoodsDao.update(realgoods);
    }

    public void deleteRealGoods(Realgoods realgoods)throws Exception{
        realGoodsDao.delete(realgoods);
    }
}
